package com.dkcrow.spring.transaction;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.dkcrow.spring.transaction.service.UserServiceImpl;

/**
 * Hello world!
 *
 */
public class AspectJTransactionApp
{
	final static Logger logger = LoggerFactory.getLogger(AspectJTransactionApp.class.getClass());
	
	public static ApplicationContext ap;
	
    public static void main( String[] args )
    {
    	ap = new ClassPathXmlApplicationContext("spring/*-jdbc-context.xml");
    	
    	UserServiceImpl userServiceImpl = (UserServiceImpl) ap.getBean("userServiceImpl");
    	userServiceImpl.deleteAllUser();
    	
    	try {
			userServiceImpl.excute();
		} catch (Exception e) {
			logger.error("예상된 에러!!",e);
		}
    	userServiceImpl.testLocalMethod();
    }
}
